package com.tourism.website.articlemanage.mapper;

import cn.hutool.core.date.DateTime;
import com.tourism.website.articlemanage.entity.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tourismwebsite.articlemanage.dto.ArticleManageDTO;
import org.apache.ibatis.annotations.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author kevin
 * @since 2024-06-11
 */
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    //0通过，1不通过，2审批中
    @Update("UPDATE article SET status = #{Status}, reviewer = #{reviewer} WHERE article_id = #{articleId}")
    int updateFavoriteStatusByArticleId(Integer articleId, String Status,Integer reviewer);

    //删除文章
    @Delete("DELETE FROM article WHERE article_id = #{articleId}")
    int deleteArticleManage(Integer articleId);

    @Update("UPDATE article SET update_time=#{upDateTime},reviewer_time=#{reviewerTime} WHERE article_id = #{articleId}")
    int updateTime(Integer articleId, LocalDateTime upDateTime,LocalDateTime reviewerTime);


}
